Fix hang on UTF-16 LE BOM file#636
Conversation
|
Yeah - there's several places which lack checks for |
|
With #647 it should be possible to write a test which uses the input in question. |
Can we just run the tests with all three options? |
Yes, if somebody adds the functionality. It didn't seem straight forward to me so I haven't yet. Feel free to do so. |
|
I think I took a wrong turn. That should trigger with regular unit test. So please add a test for it. |
Ah - you mentioned |
|
So there is also some kind of platform divergence going on... |
|
These (hanging) runs may be cancelled by the way: |
Of course |
|
I guess CI will be fixed by #641 |
| const int pk = peek(); | ||
| auto ch = static_cast<unsigned char>(pk); | ||
| if (pk == EOF) | ||
| return ch; |
There was a problem hiding this comment.
I appreciate that we handle EOF. However, spontanously it does not seem optimal to return some abitrary ch value. It's implementation defined what value of EOF is right? If we would return 0xFF we at least know what the return value is. Or do we want to have the implementation defined return value?
There was a problem hiding this comment.
This needs to return EOF since we are a custom layer on top of getc(). And since we use the EOF macro it is not "arbitrary" but the one defined by the libc implementation.
fixes #637